const path = require('path');
const {LifeCircleService,ReadJsonFileList} = require("../service/ConfigService")
const {EmailService} = require("../service/EmailService")

//读取配置文件
const allConfig = ReadJsonFileList(path.join(__dirname,"../config"),['account','runtime']);

(async ()=>{  

	if(allConfig.account.email){

		const {user,pass} = allConfig.account.email;

		const emailService = new EmailService(user,pass);

		const order = {"name":"BTC-USDT","ordId":"406502014208851969","buySize":"0.00007961","balance":"421.28","price":"37683.9","amount":3,"date":"2022-01-26 17:33:52"}
		const system = { totalAmount: 6,totalCount:10,buyInterval: '8.64分钟',msg: '系统运行正常'}

		const info = await emailService.orderSuccess({order,system})

		console.log("下单信息",info)

	}

 })();
